3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides a number of general routines for managing lights of any kind.
You can use the Q3Light_GetType function to get the type of a light object.
TQ3ObjectType Q3Light_GetType (TQ3LightObject light);
The Q3Light_GetType function returns, as its function result, the type of the light object specified by the light parameter. The types of light objects currently supported by QuickDraw 3D are defined by these constants:
kQ3LightTypeAmbient
kQ3LightTypeDirectional
kQ3LightTypePoint
kQ3LightTypeSpot
If the specified light object is invalid or is not one of these types, Q3Light_GetType returns the value kQ3ObjectTypeInvalid .
You can use the Q3Light_GetState function to get the current state of a light.
TQ3Status Q3Light_GetState (
TQ3LightObject light,
TQ3Boolean *isOn);
You can use the Q3Light_SetState function to set the state of a light.
TQ3Status Q3Light_SetState (
TQ3LightObject light,
TQ3Boolean isOn);
You can use the Q3Light_GetBrightness function to get the current brightness of a light.
TQ3Status Q3Light_GetBrightness (
TQ3LightObject light,
float *brightness);
The Q3Light_GetBrightness function returns, in the brightness parameter, a value that indicates the current brightness of the light specified by the light parameter. The value should be between 0.0 and 1.0, inclusive. Some renderers may allow you to specify overbright lights (where the value in this field is greater than 1.0) or lights with negative brightness (where the value in this field is less than 0.0). If you have a light that has non-linear distance attenuation, you may need brightness values above 1.0 for realistic modeling (imagine the sun). The effects produced by out-of-range brightness values are renderer-specific.
You can use the Q3Light_SetBrightness function to set the brightness of a light.
TQ3Status Q3Light_SetBrightness (
TQ3LightObject light,
float brightness);
The Q3Light_SetBrightness function sets the brightness of the light specified by the light parameter to the value specified by the brightness parameter. The value should be between 0.0 and 1.0, inclusive. Some renderers may allow you to specify overbright lights (where the value in this field is greater than 1.0) or lights with negative brightness (where the value in this field is less than 0.0). If you have a light that has non-linear distance attenuation, you may need brightness values above 1.0 for realistic modeling (imagine the sun). The effects produced by out-of-range brightness values are renderer-specific.
You can use the Q3Light_GetColor function to get the current color of a light.
TQ3Status Q3Light_GetColor (
TQ3LightObject light,
TQ3ColorRGB *color);
You can use the Q3Light_SetColor function to set the color of a light.
TQ3Status Q3Light_SetColor (
TQ3LightObject light,
const TQ3ColorRGB *color);
You can use the Q3Light_GetData function to get the basic data associated with a light.
TQ3Status Q3Light_GetData (
TQ3LightObject light,
TQ3LightData *lightData);
The Q3Light_GetData function returns, through the lightData parameter, basic information about the light specified by the light parameter. See "Light Data Structure" for a description of a light data structure.
You can use the Q3Light_SetData function to set the basic data associated with a light.
TQ3Status Q3Light_SetData (
TQ3LightObject light,
const TQ3LightData *lightData);
Previous | QD3D Book | Overview | Chapter Contents | Next |